<%@ taglib uri="/WEB-INF/vectrics.tld" prefix="vectrics" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>

<%@ page import="org.vectrics.provider.*" %>
<%@ page import="org.vectrics.user.*" %>
<%@ page import="org.vectrics.hibernate.ThreadProperties" %>
<%@ page import="org.vectrics.struts.*" %>
<%
	Request vectricsRequest = HttpRequestConverter.convertRequest(request);
	String evalId = request.getParameter("evalId");
	if ((evalId == null) || (evalId.length() == 0)) {
		evalId = request.getParameter("ownerId");
	}
	

	if ((evalId != null) && (evalId.length() == 0)) {
		evalId = null;
	}
	
	Person person = CoreServiceLocator.getUserAuthService().getAuthorizedPerson(vectricsRequest);
	String personId = "" + person.getId();
	String enterHref = "/hrs-public/profile/" + ThreadProperties.getUriDomainId() + "/skill/skillEntry.do";	
%>

<vectrics:errors/>


<% if (evalId == null) { 
		String noSkillsMessage = CoreServiceLocator.getPhraseProvider().getMessage("phrase.self.skills.not.entered", request.getLocale());
			%> 
		<h2><%=noSkillsMessage%></h2>
		<vectrics:button 
				href="<%=enterHref%>"
				code="public.button.wide"
				phraseCode="button.skill.self.enter"					
				paramName="personId"
				paramValue="<%=personId%>"
				/>
	
<% } else { %>
		<vectrics:button 
				href="<%=enterHref%>"
				code="public.button.wide"
				phraseCode="button.skill.self.enter"					
				paramName="evaluationId"
				paramValue="<%=evalId%>"
				/>
		<br>
		<vectrics:userSkillsSummary evaluationId="<%=evalId%>" />
		<br>
		<vectrics:button 
				href="<%=enterHref%>"
				code="public.button.wide"
				phraseCode="button.skill.self.enter"					
				paramName="evaluationId"
				paramValue="<%=evalId%>"
				/>
		
<% } %>


